<div class="widget-content">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'type-form',
	'enableAjaxValidation'=>false,
	'htmlOptions'=>array('class'=>'form-horizontal', 'novalidate'=>'novalidate','enctype' => 'multipart/form-data'),
)); ?>
	<?php if($form->errorSummary($model)):?>
			<div class="alert alert-block">
				<a class="close" data-dismiss="alert" href="#">&times;</a>
				<h4 class="alert-heading"><?php echo $form->errorSummary($model); ?></h4>
			</div>
	<?php endif;?>
	<fieldset>
	<div class="control-group">
		<?php echo $form->labelEx($model,'name',array('class'=>'control-label','for'=>'name')); ?>
		<div class="controls">
			<?php echo $form->textField($model,'name',array('size'=>60,'maxlength'=>200,'class'=>'input-large')); ?>
		</div>
		<?php echo $form->error($model,'name'); ?>
	</div>
	<div class="control-group">
				<?php echo $form->labelEx($model,'Icon',array('class'=>'control-label','for'=>'icon')); ?>
				<div class="controls">
					<?php $this->widget('ext.kcfinder.EImageFinder',array('model'=>$model,'fieldName'=>'icon','type'=>'images'));?>
					<?php echo $form->error($model,'icon'); ?>
					<div id="ckeditor">
					</div>
					<?php if($model->icon){
							echo '<div><img src="'.$model->icon.'" style="max-width:150px"/></div>';
						}
					?>
				</div>
				<?php echo $form->error($model,'icon'); ?>
	</div>
	<div class="control-group">
		<?php echo $form->labelEx($model,'Description',array('class'=>'control-label','for'=>'desc')); ?>
		<div class="controls">
			<?php echo $form->textArea($model,'desc',array('rows'=>6, 'cols'=>50)); ?>
		</div>
		<?php echo $form->error($model,'desc'); ?>
	</div>
	<div class="control-group">
		<?php echo $form->labelEx($model,'hot',array('class'=>'control-label','for'=>'hot')); ?>
		<div class="controls">
			<div class="btn-group" data-toggle="buttons-radio">
			<button onclick="document.getElementById('Type_hot').value=1;return false;" class="btn btn-primary <?php if($model->hot=='1'){echo 'active';}?>">True</button>
			<button onclick="document.getElementById('Type_hot').value=0;return false;" class="btn btn-primary <?php if($model->hot!='1'){echo 'active';}?>">False</button>
			
			</div>
		</div>
		<?php echo $form->hiddenField($model,'hot'); ?>
		<?php echo $form->error($model,'hot'); ?>
	</div>
	<?php echo $form->hiddenField($model,'order'); ?>
	<div class="control-group">
				<?php echo $form->labelEx($model,'active',array('class'=>'control-label','for'=>'active')); ?>
				<div class="controls">
				
					<div class="btn-group" data-toggle="buttons-radio">
				       <button onclick="document.getElementById('Type_active').value=1;return false;" class="btn btn-primary <?php if($model->active!='0'){echo 'active';}?>">True</button>
				       <button onclick="document.getElementById('Type_active').value=0;return false;" class="btn btn-primary <?php if($model->active=='0'){echo 'active';}?>">False</button>
				       
				 	</div>
				</div>
				<?php echo $form->hiddenField($model,'active'); ?>
				<?php echo $form->error($model,'active'); ?>
	</div>
	<div class="form-actions">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save',array('class'=>'btn btn-primary btn-large')); ?>
		<?php echo CHtml::link('Cancel',array('/category/admin'),array('class'=>'btn btn-large')); ?>
	</div>
	</fieldset>
<?php $this->endWidget(); ?>
</div><!-- form -->